package net.huashitong.scheduling.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.sirdc.modules.core.dao.GenericQuery;
import com.sirdc.modules.core.dao.StringDao;

import net.huashitong.scheduling.entity.TownshipGrade;

@Repository
public class TownshipGradeDao extends StringDao<TownshipGrade>{
      public List<TownshipGrade> queryByMonth(String month,String parentId){
    	  GenericQuery query = createQuery("obj");
    	  query.append(" and obj.currentMonth= :currentMonth").setParam("currentMonth", month);
    	  query.append(" and obj.parentId= :parentId order by cast(obj.reatioRanking as int) ASC ").setParam("parentId", parentId);
    	  return query.listResult();
      }
      public List<TownshipGrade> queryByParentId(String parentId){
    	  GenericQuery query = createQuery("obj");
    	  query.append(" and obj.parentId= :parentId").setParam("parentId", parentId);
    	  return query.listResult();
      }
}
